import React from "react";
import ThemContext from "../context";
import eventBus from '../utils/event-bus'
class HelloWord extends React.Component{
   constructor(props){
    console.log('创建组件',props);
    super();
   }
   componentDidMount(){
      console.log('组件挂载完成');
   }
   handlePrev(){
      console.log('上一个');
      eventBus.emit('prevFn','张三','180','26');
   }
   render(){
      console.log(this.context,'我是Hellow')
    console.log('开始挂载组件');
     return(
      <>
        <h2>我是HelloWord</h2>
        <button onClick={this.handlePrev}>上一个</button>
        <button>下一个</button>
      </>
     )
   }
}

HelloWord.contextType = ThemContext;
export { HelloWord};